﻿Imports System.IO
Imports System.Data
Imports System.Data.SqlClient
Imports System.Data.OleDb
Imports System.Collections.Generic


Partial Public Class admin_personal
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
        CargarArchivos.Cargar(FileUpload1, Me.Request, Me.GridView1)

        'If FileUpload1.HasFile Then

        '    Dim fileName As String = Path.GetExtension(FileUpload1.PostedFile.FileName)
        '    Dim fileExt As String = Path.GetExtension(FileUpload1.PostedFile.FileName)
        '    Dim uploadPath = "~/Uploaded Folder/"
        '    Dim filePath = Server.MapPath(uploadPath + fileName)
        '    FileUpload1.SaveAs(filePath)
        '    Dim conStr As String = ""
        '    If (fileExt = ".xls") Or (fileExt = "XLS") Then
        '        conStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source='" + filePath + "'" + "; Extended Properties ='Excel 8.0;HDR=Yes'"
        '    ElseIf (fileExt = ".xlsx") Or (fileExt = "XLSX") Then
        '        conStr = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" + filePath + "; Extended Properties ='Excel 8.0;HDR=Yes'"
        '    End If
        '    conStr = String.Format(conStr, filePath)
        '    Dim con As New OleDbConnection(conStr)
        '    'Dim _oledbConn As New OleDbConnection(conStr)
        '    Dim dt As New DataTable
        '    Try
        '        con.Open()
        '        Dim cmd As OleDbCommand = New OleDbCommand("Select [id],[CARNET],[apellidos],[nombres],[email],[telefono],[estado] from [Hoja1$]", con)
        '        Dim dp As OleDbDataAdapter = New OleDbDataAdapter()
        '        Dim ds As New DataSet()


        '        dp.SelectCommand = cmd
        '        dp.Fill(ds)
        '        GridView1.DataSource=ds.Tables[0].DefaultViewManager
        '        GridView1.DataBind()

        '        dp.Dispose()
        '        cmd.Dispose()

        '    Catch ex As Exception

        '    Finally
        '        con.Close()
        '        con.Dispose()

        '    End Try




        'End If
    End Sub
    
    Protected Sub Button2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button2.Click

    End Sub
End Class